package com.zhangyj.entitis;

public class TreeItem extends BaseBeen{
	private static final long serialVersionUID = 6490073864900956968L;
	private int id;
	private String code;
	private String description;
	private boolean leaf;
	private int treeId;

	public TreeItem(int treeId,int id, String code, String description, boolean leaf) {
		setTreeId(treeId);
		this.setCode(code);
		this.setDescription(description);
		this.setId(id);
		this.setLeaf(leaf);
	}
	public TreeItem(TreeItem item) {
		this.setCode(item.code);
		this.setDescription(item.description);
		this.setId(item.id);
		this.setLeaf(item.leaf);
	}

	public TreeItem() {
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		if (code == null)
			code = "";
		this.code = code;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		if (description == null)
			description = "";
		this.description = description;
	}

	public boolean isLeaf() {
		return leaf;
	}

	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	public int compareTo(TreeItem item) {
		return this.code.compareTo(item.getCode());
	}
	public int getTreeId() {
		return treeId;
	}
	public void setTreeId(int treeId) {
		this.treeId = treeId;
	}

}
